<template>
  <div class="son">
    子组件1
    <p>{{son_arr}}</p>
    <button @click="sendData">给父组件传值</button>
  </div>
</template>

<script>
export default {
  data () {
    return {
      sonstring: "子组件的字符串"
    }
  },
  props: {
    son_arr: {
      type: Array,
      default: null
    },
  },
  methods: {
    sendData () {
      this.$emit('getData', this.sonstring)
    }
  }
}
</script>

<style lang="less" scoped>
.son {
  height: 200px;
  width: 200px;
  background-color: lightblue;
}
</style>
